﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace HengTong.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class SysWorkflow新增提交部门和组织信息 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "SubmitterGroupId",
                table: "SysWorkflow",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "SubmitterGroupName",
                table: "SysWorkflow",
                type: "nvarchar(100)",
                maxLength: 100,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "SubmitterName",
                table: "SysWorkflow",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "SubmitterOrgId",
                table: "SysWorkflow",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "SubmitterOrgName",
                table: "SysWorkflow",
                type: "nvarchar(100)",
                maxLength: 100,
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OrgId",
                table: "SysVisitorRecordRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OrgId",
                table: "SysHrTransferRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OrgId",
                table: "SysHrStaffNeedRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OrgId",
                table: "SysHrRetireRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OrgId",
                table: "SysHrResignRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OrgId",
                table: "SysHrRenewRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OrgId",
                table: "SysHrRecruitRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OrgId",
                table: "SysHrDismissRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OrgId",
                table: "SysDailyOutFactoryRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OrgId",
                table: "SysDailyLeaveRequestBill",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_SysVisitorRecordRequestBill_OrgId",
                table: "SysVisitorRecordRequestBill",
                column: "OrgId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrTransferRequestBill_OrgId",
                table: "SysHrTransferRequestBill",
                column: "OrgId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrStaffNeedRequestBill_OrgId",
                table: "SysHrStaffNeedRequestBill",
                column: "OrgId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrRetireRequestBill_OrgId",
                table: "SysHrRetireRequestBill",
                column: "OrgId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrResignRequestBill_OrgId",
                table: "SysHrResignRequestBill",
                column: "OrgId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrRenewRequestBill_OrgId",
                table: "SysHrRenewRequestBill",
                column: "OrgId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrRecruitRequestBill_OrgId",
                table: "SysHrRecruitRequestBill",
                column: "OrgId");

            migrationBuilder.CreateIndex(
                name: "IX_SysHrDismissRequestBill_OrgId",
                table: "SysHrDismissRequestBill",
                column: "OrgId");

            migrationBuilder.CreateIndex(
                name: "IX_SysDailyOutFactoryRequestBill_OrgId",
                table: "SysDailyOutFactoryRequestBill",
                column: "OrgId");

            migrationBuilder.CreateIndex(
                name: "IX_SysDailyLeaveRequestBill_OrgId",
                table: "SysDailyLeaveRequestBill",
                column: "OrgId");

            migrationBuilder.AddForeignKey(
                name: "FK_SysDailyLeaveRequestBill_SysOrg_OrgId",
                table: "SysDailyLeaveRequestBill",
                column: "OrgId",
                principalTable: "SysOrg",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysDailyOutFactoryRequestBill_SysOrg_OrgId",
                table: "SysDailyOutFactoryRequestBill",
                column: "OrgId",
                principalTable: "SysOrg",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrDismissRequestBill_SysOrg_OrgId",
                table: "SysHrDismissRequestBill",
                column: "OrgId",
                principalTable: "SysOrg",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrRecruitRequestBill_SysOrg_OrgId",
                table: "SysHrRecruitRequestBill",
                column: "OrgId",
                principalTable: "SysOrg",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrRenewRequestBill_SysOrg_OrgId",
                table: "SysHrRenewRequestBill",
                column: "OrgId",
                principalTable: "SysOrg",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrResignRequestBill_SysOrg_OrgId",
                table: "SysHrResignRequestBill",
                column: "OrgId",
                principalTable: "SysOrg",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrRetireRequestBill_SysOrg_OrgId",
                table: "SysHrRetireRequestBill",
                column: "OrgId",
                principalTable: "SysOrg",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrStaffNeedRequestBill_SysOrg_OrgId",
                table: "SysHrStaffNeedRequestBill",
                column: "OrgId",
                principalTable: "SysOrg",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrTransferRequestBill_SysOrg_OrgId",
                table: "SysHrTransferRequestBill",
                column: "OrgId",
                principalTable: "SysOrg",
                principalColumn: "ID");

            migrationBuilder.AddForeignKey(
                name: "FK_SysVisitorRecordRequestBill_SysOrg_OrgId",
                table: "SysVisitorRecordRequestBill",
                column: "OrgId",
                principalTable: "SysOrg",
                principalColumn: "ID");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_SysDailyLeaveRequestBill_SysOrg_OrgId",
                table: "SysDailyLeaveRequestBill");

            migrationBuilder.DropForeignKey(
                name: "FK_SysDailyOutFactoryRequestBill_SysOrg_OrgId",
                table: "SysDailyOutFactoryRequestBill");

            migrationBuilder.DropForeignKey(
                name: "FK_SysHrDismissRequestBill_SysOrg_OrgId",
                table: "SysHrDismissRequestBill");

            migrationBuilder.DropForeignKey(
                name: "FK_SysHrRecruitRequestBill_SysOrg_OrgId",
                table: "SysHrRecruitRequestBill");

            migrationBuilder.DropForeignKey(
                name: "FK_SysHrRenewRequestBill_SysOrg_OrgId",
                table: "SysHrRenewRequestBill");

            migrationBuilder.DropForeignKey(
                name: "FK_SysHrResignRequestBill_SysOrg_OrgId",
                table: "SysHrResignRequestBill");

            migrationBuilder.DropForeignKey(
                name: "FK_SysHrRetireRequestBill_SysOrg_OrgId",
                table: "SysHrRetireRequestBill");

            migrationBuilder.DropForeignKey(
                name: "FK_SysHrStaffNeedRequestBill_SysOrg_OrgId",
                table: "SysHrStaffNeedRequestBill");

            migrationBuilder.DropForeignKey(
                name: "FK_SysHrTransferRequestBill_SysOrg_OrgId",
                table: "SysHrTransferRequestBill");

            migrationBuilder.DropForeignKey(
                name: "FK_SysVisitorRecordRequestBill_SysOrg_OrgId",
                table: "SysVisitorRecordRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysVisitorRecordRequestBill_OrgId",
                table: "SysVisitorRecordRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysHrTransferRequestBill_OrgId",
                table: "SysHrTransferRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysHrStaffNeedRequestBill_OrgId",
                table: "SysHrStaffNeedRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysHrRetireRequestBill_OrgId",
                table: "SysHrRetireRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysHrResignRequestBill_OrgId",
                table: "SysHrResignRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysHrRenewRequestBill_OrgId",
                table: "SysHrRenewRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysHrRecruitRequestBill_OrgId",
                table: "SysHrRecruitRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysHrDismissRequestBill_OrgId",
                table: "SysHrDismissRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysDailyOutFactoryRequestBill_OrgId",
                table: "SysDailyOutFactoryRequestBill");

            migrationBuilder.DropIndex(
                name: "IX_SysDailyLeaveRequestBill_OrgId",
                table: "SysDailyLeaveRequestBill");

            migrationBuilder.DropColumn(
                name: "SubmitterGroupId",
                table: "SysWorkflow");

            migrationBuilder.DropColumn(
                name: "SubmitterGroupName",
                table: "SysWorkflow");

            migrationBuilder.DropColumn(
                name: "SubmitterName",
                table: "SysWorkflow");

            migrationBuilder.DropColumn(
                name: "SubmitterOrgId",
                table: "SysWorkflow");

            migrationBuilder.DropColumn(
                name: "SubmitterOrgName",
                table: "SysWorkflow");

            migrationBuilder.DropColumn(
                name: "OrgId",
                table: "SysVisitorRecordRequestBill");

            migrationBuilder.DropColumn(
                name: "OrgId",
                table: "SysHrTransferRequestBill");

            migrationBuilder.DropColumn(
                name: "OrgId",
                table: "SysHrStaffNeedRequestBill");

            migrationBuilder.DropColumn(
                name: "OrgId",
                table: "SysHrRetireRequestBill");

            migrationBuilder.DropColumn(
                name: "OrgId",
                table: "SysHrResignRequestBill");

            migrationBuilder.DropColumn(
                name: "OrgId",
                table: "SysHrRenewRequestBill");

            migrationBuilder.DropColumn(
                name: "OrgId",
                table: "SysHrRecruitRequestBill");

            migrationBuilder.DropColumn(
                name: "OrgId",
                table: "SysHrDismissRequestBill");

            migrationBuilder.DropColumn(
                name: "OrgId",
                table: "SysDailyOutFactoryRequestBill");

            migrationBuilder.DropColumn(
                name: "OrgId",
                table: "SysDailyLeaveRequestBill");
        }
    }
}
